home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 May
/
EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso
/
earcd
/
util
/
dir
/
managers.lha
/
Managers
/
Dir
/
Dir.read
< prev
next >
Wrap
Text File
|
1997-01-15
|
4KB
|
181 lines
G4C
; This is a full blown text reader. It's a window with a listview.
; It reads the file you tell it and shows it.
WinBig 0 11 0 -13 "Loading..." ; you may want to change the position
WinSmall 0 -1 150 21
WinType 11110001
;------> On Loading, we open the gui's window..
; and load the file stated in the variable "FILENAME"
; This has been set by an other GUI, since we get called from there.
xOnLoad
setscreen dir.read $lv_fmscreen
setgad dir.read 2 hide ; hide the 2nd listview
guiopen Dir.read
gosub Dir.read filechange
;-------> Upon closing, we quit so as not to use-up memory
xOnClose
guiquit Dir.read
xOnQuit
delvar dglv_#?
;------> Routine to load & show file
xRoutine filechange ; routine to load & show file
guiscreen Dir.read front
SetWinTitle Dir.read "Loading...."
LVChange Dir.read 1 $FILENAME
SetWinTitle Dir.read '$FILENAME '
;------------> the listview. - Use 'L' for scrolling the list up/down
xListview 0 0 0 0 "" dglv_line "" 20 TXT
GadID 1
GadKey L
GadFont topaz.font 8 000 ; CHANGE THE FONT HERE!
; -----------> This is an other Listview which we will use as a temporary
; storage place. Note : we hide it upon loading of the window!
xListview 0 0 0 0 "" dglv_line2 "" 20 NUM
gadid 2
; Herebelow are our menus, which do various things to the file
;========================== PROJECT MENU
xMenu Project Open.. "" O ; load a new file
extract FILENAME PATH dglv_path
setvar dglv_getfile ""
ReqFile -1 -1 250 200 "Choose file" LOAD dglv_getfile $dglv_path
if $dglv_getfile != ""
setvar FILENAME $dglv_getfile
gosub Dir.read filechange
endif
delvar dglv_getfile
delvar dglv_path
xMenu Project Copy.. "" C
setvar dg_dest ""
ReqFile -1 -1 250 150 "Copy to :" DIR dg_dest ''
if $dg_dest > ""
action copy $FILENAME $dg_dest
setwintitle Dir.read 'Copied : $FILENAME '
endif
delvar dg_dest
xMenu Project Move.. "" M
setvar dg_dest ""
ReqFile -1 -1 250 150 "Move to :" DIR dg_dest ''
if $dg_dest > ""
action move $FILENAME $dg_dest
setwintitle Dir.read 'Moved : $FILENAME '
endif
delvar dg_dest
xMenu Project Rename.. "" R
setvar dg_dest ""
ReqFile -1 -1 250 150 "Rename to :" SAVE dg_dest ''
if $dg_dest > ""
rename $FILENAME $dg_dest
FILENAME = $dg_dest
setwintitle Dir.read '$FILENAME '
endif
delvar dg_dest
xMenu Project Delete.. "" D
EZReq 'Delete file :\n$FILENAME ?' DELETE|CANCEL dg_choice
if $dg_choice = 1
setwintitle Dir.read 'Deleted : $FILENAME '
delete $FILENAME
endif
delvar dg_choice
xMenu Project BARLABEL "" ""
xMenu Project Status "" S
status
xMenu Project About "" ""
ezreq 'Reading file:\n$FILENAME\n\nWith Dir.read' 'So I am..' ""
xMenu Project Quit "" Q
guiquit Dir.read
; ======================== EDIT MENU
xMenu Edit C:Ed '' E
guiclose Dir.read
run 'c:ed $FILENAME'
xMenu Edit C:CEd '' '' ; for CygnusEd
guiclose Dir.read
ifexists port rexx_ced
sendrexx rexx_ced 'open new'
sendrexx rexx_ced 'open $FILENAME'
guiscreen cedbar.gc FRONT
else
guiload guis:demos/ced/cedbar.gc
sendrexx rexx_ced 'open $FILENAME'
endif
; ========================== Action MENU
xMenu Action Run.. "" "" ; run it through the dir.cli GUI
guiclose Dir.read
setvar cl_Main '$FILENAME '
guiopen dir.cli
update dir.cli 10 2
setgad dir.cli 1 ON
xMenu Action Execute.. "" "" ; also through dir.cli
guiclose Dir.read
setvar cl_Main 'Execute $FILENAME '
guiopen dir.cli
update dir.cli 10 1
setgad dir.cli 1 ON
xMenu Action View "" V ; use the viewfile routine
guiclose Dir.read
rtn.option = 'run >nil:'
guiload :dir.view
gosub dir.view ViewFile
xMenu Action "View Hex" "" H ; Change it here to your favourite hex reader
guiclose Dir.read
run '$DEF.HEX $FILENAME'
;=============== ON FAILING
xOnFail
SetWinTitle Dir.read '**ERROR** $FILENAME '